package cn.seqdata.rpt.simple.query;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.google.common.collect.Table;

/** 事实表查询 */
public class FactDataQuerier extends AbstractTableQuerier<Integer> {
	private final String sql;

	public FactDataQuerier(String sql) {
		super();

		this.sql = sql;
	}

	@Override
	public void query(Table<Integer, String, Object> table, Object... args) {
		CubeTableCallbackHandler<Integer> callbackHandler = new CubeTableCallbackHandler<Integer>(table) {
			@Override
			protected Integer rowKey(ResultSet rs, int rowNum) throws SQLException {
				return rowNum;
			}
		};
		getJdbcTemplate().query(sql, callbackHandler, args);
	}
}
